package com.lekang.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lekang.common.core.domain.entity.SysUser;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lekang.common.annotation.Excel;
import com.lekang.common.core.domain.BaseEntity;

/**
 * 入住管理对象 check_in_management
 * 
 * @author 刘卓
 * @date 2025-10-13
 */
@Data
public class CheckInManagement extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @Excel(name = "主键ID")
    private Long id;

    /** 入住单号 */
    @Excel(name = "入住单号")
    private String checkInNo;

    /** 老人外键编号 */
    @Excel(name = "老人外键编号")
    private Long elderlyId;

    /** 入住开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "入住开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date checkInStartTime;

    /** 入住预结束时间 */
    private Date checkInEndTime;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long creator;

    /** 护理等级外键编号 */
    private Long nursingLevelId;

    /** 入住床位外键编号 */
    @Excel(name = "入住床位外键编号")
    private Long bedId;

    /** 费用期限开始时间 */
    private Date feeStartDate;

    /** 费用期限结束时间 */
    private Date feeEndDate;

    /** 押金 */
    private BigDecimal deposit;

    /** 护理费用 */
    private BigDecimal nursingFee;

    /** 床位费用 */
    private BigDecimal bedFee;

    /** 其他费用 */
    private BigDecimal otherFee;

    /** 医保支付 */
    private BigDecimal medicalInsurancePayment;

    /** 政府补贴 */
    private BigDecimal governmentSubsidy;

    /** 业务ID */
    private String businessId;

    /** 额外字段1 */
    private String extraField1;

    /** 额外字段2 */
    private String extraField2;

    /** 评估草稿数据（JSON格式，用于保存分步骤提交的临时数据） */
    private String assessmentDraftJson;

    /** 家人联系方式 */
    private String contact;

    /** 家人关系 */
    private String relationship;

    //关联老人表
    private Elderly elderly;
    //关联用户表
    private SysUser sysUser;
    //关联床位表
    private Bed bed;
    //关联合同表
    private Contract contract;
    //关联家属列表（通过老人ID查询）
    private List<FamilyMember> familyMembers;

    // ===================== 新增内存级关联字段（无数据库对应字段）=====================
    /** 关联：当前入住记录对应的护理等级（多对1） */
    private NursingLevel nursingLevel;
    // =============================================================================

    // 新增：老人姓名（查询专用，接收前端传递的筛选参数）
    private String name;
    // 新增：老人身份证号（查询专用，接收前端传递的筛选参数）
    private String idCard;
    // 新增：合同编号（查询专用，接收前端传递的筛选参数）
    private String contractNo;
    
    // ===================== 合同相关字段（从合同表关联查询）=====================
    /** 合同编号 */
    private String contractNumber;
    /** 合同名称 */
    private String contractName;
    /** 合同开始日期 */
    private Date contractStartDate;
    /** 合同结束日期 */
    private Date contractEndDate;
    /** 签约日期 */
    private Date signDate;
    /** 丙方姓名 */
    private String partyCName;
    /** 丙方联系方式 */
    private String partyCcontact;
    /** 合同状态 */
    private String contractStatus;
    /** 合同文件 */
    private String contractFile;


    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setCheckInNo(String checkInNo) 
    {
        this.checkInNo = checkInNo;
    }

    public String getCheckInNo() 
    {
        return checkInNo;
    }

    public void setElderlyId(Long elderlyId) 
    {
        this.elderlyId = elderlyId;
    }

    public Long getElderlyId() 
    {
        return elderlyId;
    }

    public void setCheckInStartTime(Date checkInStartTime) 
    {
        this.checkInStartTime = checkInStartTime;
    }

    public Date getCheckInStartTime() 
    {
        return checkInStartTime;
    }

    public void setCheckInEndTime(Date checkInEndTime) 
    {
        this.checkInEndTime = checkInEndTime;
    }

    public Date getCheckInEndTime() 
    {
        return checkInEndTime;
    }

    public void setCreator(Long creator) 
    {
        this.creator = creator;
    }

    public Long getCreator() 
    {
        return creator;
    }

    public void setNursingLevelId(Long nursingLevelId) 
    {
        this.nursingLevelId = nursingLevelId;
    }

    public Long getNursingLevelId() 
    {
        return nursingLevelId;
    }

    public void setBedId(Long bedId) 
    {
        this.bedId = bedId;
    }

    public Long getBedId() 
    {
        return bedId;
    }

    public void setFeeStartDate(Date feeStartDate) 
    {
        this.feeStartDate = feeStartDate;
    }

    public Date getFeeStartDate() 
    {
        return feeStartDate;
    }

    public void setFeeEndDate(Date feeEndDate) 
    {
        this.feeEndDate = feeEndDate;
    }

    public Date getFeeEndDate() 
    {
        return feeEndDate;
    }

    public void setDeposit(BigDecimal deposit) 
    {
        this.deposit = deposit;
    }

    public BigDecimal getDeposit() 
    {
        return deposit;
    }

    public void setNursingFee(BigDecimal nursingFee) 
    {
        this.nursingFee = nursingFee;
    }

    public BigDecimal getNursingFee() 
    {
        return nursingFee;
    }

    public void setBedFee(BigDecimal bedFee) 
    {
        this.bedFee = bedFee;
    }

    public BigDecimal getBedFee() 
    {
        return bedFee;
    }

    public void setOtherFee(BigDecimal otherFee) 
    {
        this.otherFee = otherFee;
    }

    public BigDecimal getOtherFee() 
    {
        return otherFee;
    }

    public void setMedicalInsurancePayment(BigDecimal medicalInsurancePayment) 
    {
        this.medicalInsurancePayment = medicalInsurancePayment;
    }

    public BigDecimal getMedicalInsurancePayment() 
    {
        return medicalInsurancePayment;
    }

    public void setGovernmentSubsidy(BigDecimal governmentSubsidy) 
    {
        this.governmentSubsidy = governmentSubsidy;
    }

    public BigDecimal getGovernmentSubsidy() 
    {
        return governmentSubsidy;
    }

    public void setBusinessId(String businessId) 
    {
        this.businessId = businessId;
    }

    public String getBusinessId() 
    {
        return businessId;
    }

    public void setExtraField1(String extraField1) 
    {
        this.extraField1 = extraField1;
    }

    public String getExtraField1() 
    {
        return extraField1;
    }

    public void setExtraField2(String extraField2) 
    {
        this.extraField2 = extraField2;
    }

    public String getExtraField2() 
    {
        return extraField2;
    }

    public void setAssessmentDraftJson(String assessmentDraftJson) 
    {
        this.assessmentDraftJson = assessmentDraftJson;
    }

    public String getAssessmentDraftJson() 
    {
        return assessmentDraftJson;
    }

    public void setContact(String contact) 
    {
        this.contact = contact;
    }

    public String getContact() 
    {
        return contact;
    }

    public void setRelationship(String relationship) 
    {
        this.relationship = relationship;
    }

    public String getRelationship() 
    {
        return relationship;
    }

    // ===================== 合同相关字段的getter和setter方法 =====================
    public void setContractNumber(String contractNumber) 
    {
        this.contractNumber = contractNumber;
    }

    public String getContractNumber() 
    {
        return contractNumber;
    }

    public void setContractName(String contractName) 
    {
        this.contractName = contractName;
    }

    public String getContractName() 
    {
        return contractName;
    }

    public void setContractStartDate(Date contractStartDate) 
    {
        this.contractStartDate = contractStartDate;
    }

    public Date getContractStartDate() 
    {
        return contractStartDate;
    }

    public void setContractEndDate(Date contractEndDate) 
    {
        this.contractEndDate = contractEndDate;
    }

    public Date getContractEndDate() 
    {
        return contractEndDate;
    }

    public void setSignDate(Date signDate) 
    {
        this.signDate = signDate;
    }

    public Date getSignDate() 
    {
        return signDate;
    }

    public void setPartyCName(String partyCName) 
    {
        this.partyCName = partyCName;
    }

    public String getPartyCName() 
    {
        return partyCName;
    }

    public void setPartyCcontact(String partyCcontact) 
    {
        this.partyCcontact = partyCcontact;
    }

    public String getPartyCcontact() 
    {
        return partyCcontact;
    }

    public void setContractStatus(String contractStatus) 
    {
        this.contractStatus = contractStatus;
    }

    public String getContractStatus() 
    {
        return contractStatus;
    }

    public void setContractFile(String contractFile) 
    {
        this.contractFile = contractFile;
    }

    public String getContractFile() 
    {
        return contractFile;
    }

    public void setContractNo(String contractNo) 
    {
        this.contractNo = contractNo;
    }

    public String getContractNo() 
    {
        return contractNo;
    }

    public void setContract(Contract contract) 
    {
        this.contract = contract;
    }

    public Contract getContract() 
    {
        return contract;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("checkInNo", getCheckInNo())
            .append("elderlyId", getElderlyId())
            .append("checkInStartTime", getCheckInStartTime())
            .append("checkInEndTime", getCheckInEndTime())
            .append("creator", getCreator())
            .append("createTime", getCreateTime())
            .append("nursingLevelId", getNursingLevelId())
            .append("bedId", getBedId())
            .append("feeStartDate", getFeeStartDate())
            .append("feeEndDate", getFeeEndDate())
            .append("deposit", getDeposit())
            .append("nursingFee", getNursingFee())
            .append("bedFee", getBedFee())
            .append("otherFee", getOtherFee())
            .append("medicalInsurancePayment", getMedicalInsurancePayment())
            .append("governmentSubsidy", getGovernmentSubsidy())
            .append("businessId", getBusinessId())
            .append("extraField1", getExtraField1())
            .append("extraField2", getExtraField2())
            .toString();
    }
}
